package com.foucus.myfouces.MVP.View.views.Fragment;

import android.app.Activity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.foucus.myfouces.Base.BaseFragment;
import com.foucus.myfouces.R;
import com.foucus.myfouces.Resource.Util.SharedPreferencesUtil;
import com.foucus.myfouces.Resource.view.CircleImageView;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by yf-06 on 2017/6/27.
 * 我的
 */

public class MyFg extends BaseFragment implements View.OnClickListener {
    @Bind(R.id.img_back)
    ImageView img_back;
    @Bind(R.id.lly_back)
    LinearLayout lly_back;
    @Bind(R.id.tv_title_bar_title)
    TextView tv_title_bar_title;
    @Bind(R.id.img_title_bar_right)
    ImageView img_title_bar_right;
    @Bind(R.id.lly_title_bar_right)
    LinearLayout lly_title_bar_right;
    @Bind(R.id.tv_save)
    TextView tv_save;
    @Bind(R.id.cimg_my_icon)
    CircleImageView cimg_my_icon;
    @Bind(R.id.tv_my_name)
    TextView tv_my_name;
    @Bind(R.id.tv_my_edit)
    TextView tv_my_edit;
    @Bind(R.id.lly_my_clcik)
    LinearLayout lly_my_clcik;
    @Bind(R.id.tv_my_works_num)
    TextView tv_my_works_num;
    @Bind(R.id.tv_my_forward_num)
    TextView tv_my_forward_num;
    @Bind(R.id.tv_my_follow_num)
    TextView tv_my_follow_num;
    @Bind(R.id.tv_my_fans_num)
    TextView tv_my_fans_num;
    @Bind(R.id.rly_my_homepage)
    RelativeLayout rly_my_homepage;
    @Bind(R.id.tv_my_newsnum)
    TextView tv_my_newsnum;
    @Bind(R.id.rly_my_news)
    RelativeLayout rly_my_news;
    @Bind(R.id.rly_my_atlas)
    RelativeLayout rly_my_atlas;
    @Bind(R.id.rly_my_friends)
    RelativeLayout rly_my_friends;
    @Bind(R.id.rly_my_transmission)
    RelativeLayout rly_my_transmission;
    @Bind(R.id.rly_my_download)
    RelativeLayout rly_my_download;
    @Bind(R.id.rly_my_draft)
    RelativeLayout rly_my_draft;
    @Bind(R.id.lly_my_works)
    LinearLayout lly_my_works;
    @Bind(R.id.lly_my_forward)
    LinearLayout lly_my_forward;
    @Bind(R.id.lly_my_follow)
    LinearLayout lly_my_follow;
    @Bind(R.id.lly_my_fans)
    LinearLayout lly_my_fans;
    private View rootView;
    private Activity mActivity;
    private SharedPreferencesUtil sharedPreferencesUtil;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        if (rootView == null) {
            rootView = inflater.inflate(R.layout.fragment_my, container, false);
        }
        ViewGroup parent = (ViewGroup) rootView.getParent();
        if (parent != null) {
            parent.removeView(rootView);
        }
        ButterKnife.bind(this, rootView);
        return rootView;
    }

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        mActivity = getActivity();
        init();
    }

    private void init() {
        tv_title_bar_title.setText("我的");
        img_title_bar_right.setImageDrawable(getResources().getDrawable(R.mipmap.icon_setup));
    }

    @OnClick({R.id.lly_title_bar_right,
            R.id.lly_my_clcik,
            R.id.lly_my_works,
            R.id.lly_my_forward,
            R.id.lly_my_follow,
            R.id.lly_my_fans,
            R.id.rly_my_homepage,
            R.id.rly_my_news,
            R.id.rly_my_atlas,
            R.id.rly_my_friends,
            R.id.rly_my_transmission,
            R.id.rly_my_download,
            R.id.rly_my_draft,})
    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.lly_title_bar_right: //设置
                break;
            case R.id.lly_my_clcik: //编辑个人资料
                break;
            case R.id.lly_my_works: //作品
                break;
            case R.id.lly_my_forward: //转发
                break;
            case R.id.lly_my_follow: //关注
                break;
            case R.id.lly_my_fans: //粉丝
                break;
            case R.id.rly_my_homepage: //我的主页
                break;
            case R.id.rly_my_news: //我的消息
                break;
            case R.id.rly_my_atlas: //我的图集
                break;
            case R.id.rly_my_friends: //关注好友
                break;
            case R.id.rly_my_transmission: //传输列表
                break;
            case R.id.rly_my_download: //下载列表
                break;
            case R.id.rly_my_draft: //我的存稿
                break;
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        ButterKnife.unbind(this);
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }


}
